﻿using System;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;

namespace CSW.Framework.Linq
{
    /// <summary>
    /// ITableQueryProvider&lt;T&gt;.
    /// </summary>
    /// <typeparam name="T">The table type.</typeparam>
    public interface ITableQueryProvider<T> : IOrderedQueryable<T>, IQueryProvider
    {
        /// <summary>
        /// Gets a new binding list containing all records in the table.
        /// </summary>
        /// <returns>A new binding list containing all records in the table.</returns>
        BindingList<T> GetNewBindingList();

        /// <summary>
        /// Sets the projection level.
        /// </summary>
        /// <param name="levels">The number of levels.</param>
        ITableQueryProvider<T> SetProjectionLevel(int levels);

        /// <summary>
        /// Excludes a field from being brought back from the database.
        /// </summary>
        /// <param name="field">The field to exclude.</param>
        ITableQueryProvider<T> ExcludeField<TResult>(Expression<Func<T, TResult>> field);
    }
}
